# -*- coding: UTF-8 -*-
# @author: rain_lane
# @email: 1172965673@qq.com
# @file: _1.py
# @time: 2021/6/12 10:16
# @Software: PyCharm


import requests
import execjs


headers = {
    'User-Agent': 'yuanrenxue.project'
}


with open('question_one.js', encoding='utf-8') as f:
    js_ = execjs.compile(f.read())

m = js_.call('request')

num = []
for i in range(1, 6):
    param_data = {
        'page': i,
        'm': m
    }
    url = 'http://match.yuanrenxue.com/api/match/1'
    res = requests.get(url=url, headers=headers, params=param_data).json()
    for i in res['data']:
        num.append(i['value'])

print(sum(num) / len(num))
